package com.itheima.controller;


import com.itheima.common.entity.Result;
import com.itheima.service.IReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {

    @Autowired
    private IReportService reportService;

    @GetMapping("/getMemberReport")
    public Result getMemberReport(){
        return reportService.getMemberReport();
    }

    @GetMapping("/getSetmealReport")
    public Result getSetmealReport(){
        return reportService.getSetmealReport();
    }

    @GetMapping("/getBusinessReportData")
    public Result getBusinessReportData(){
        return reportService.getBusinessReportData();
    }


    @GetMapping("/exportBusinessReport")
    public void exportBusinessReport(HttpServletResponse response){
        reportService.exportBusinessReport(response);
    }
}
